import Taro, { Component } from '@tarojs/taro'
import { Provider } from '@tarojs/mobx'
import workbench from './pages/workbench'

import counterStore from './store/counter'
import './css/iconfont.css'
import './app.scss'

// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释：
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5')  {
//   require('nerv-devtools')
// }

const store = {
  counterStore
}

class App extends Component {

  config = {
    pages: [
      'pages/serviceDetail/serviceDetail',
      'pages/serviceManager/serviceManager',
      'pages/checkout/checkout',
      'pages/getSure/getSure',
      'pages/order/order',
      'pages/getGoods/getGoods',
      'pages/receiveGoods/receiveGoods',
      'pages/profitDetail/profitDetail',
      'pages/profitRecord/profitRecord',
      'pages/profitManager/profitManager',
      'pages/getCash/getCash',
      'pages/getCashDetail/getCashDetail',
      'pages/getCashRecord/getCashRecord',
      'pages/ranking/ranking',
      'pages/login/login',
      'pages/register/register',
      'pages/my/my',
      'pages/workbench/workbench',

    ],
    window: {
      backgroundTextStyle: 'light',
      navigationBarBackgroundColor: '#fff',
      navigationBarTitleText: '团长',
      navigationBarTextStyle: 'black'
    },
    tabBar: {
      color: '#CCC',
      selectedColor: '#1791FF',
      backgroundColor: '#fff',
      borderStyle: 'black',
      list: [{
        pagePath: 'pages/workbench/workbench',
        text: '工作台',
        iconPath: 'img/work_off.png',
        selectedIconPath: 'img/work_on.png'
      },
      {
        pagePath: 'pages/my/my',
        text: '个人中心',
        iconPath: 'img/my_off.png',
        selectedIconPath: 'img/my_on.png'
      }],
      position: 'bottom',
      custom: false
    }
  }

  componentDidMount() { }

  componentDidShow() { }

  componentDidHide() { }

  componentDidCatchError() { }

  // 在 App 类中的 render() 函数没有实际作用
  // 请勿修改此函数
  render() {
    return (
      <Provider store={store}>
        <workbench />
      </Provider>
    )
  }
}

Taro.render(<App />, document.getElementById('app'))
